package de.edu.tum.agora.user;

import java.util.Scanner;

import de.edu.tum.agora.feedback.Rating;

public class User {

	private int id;
	private String name;
	private String username;
	private String email;
	private String password;
	private double rating;

	public User(int id, String name, String username, String password,
			String email, double rating) {
		super();
		this.name = name;
		this.email = email;
		this.id = id;
		this.username = username;
		this.password = password;
		this.rating = rating;
	}

	public void giveFeedback() {
		// TODO Feedback function
		int choice;
		System.out
				.println("Select which feedback option you would like to give:");
		System.out.println("1 Rating");
		System.out.println("2 Comments");
		System.out.println("3 Crash Report");
		choice = Integer.parseInt(getInput());
		switch (choice) {
		case 1:
			Rating appRating = new Rating("appName", 1.01, this);
			System.out.println(appRating);
			break;
		default:
			break;
		}

	}

	private String getInput() {
		Scanner in = new Scanner(System.in);
		String input = in.nextLine();
		return input;
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Override
	public String toString() {
		String string = id + " " + name + " " + email;
		return string;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return rating
	 */
	public double getRating() {
		return rating;
	}

	/**
	 * @param rating
	 *            rating to set
	 */
	public void setRating(double rating) {
		this.rating = rating;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

}
